# coding: utf8
# datetime: 2021-04-09
# 题目地址: https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array-ii/

from typing import List

class Solution:
    def findMin(self, nums: List[int]) -> int:
        len_nums = len(nums)
        low, high = 0, len_nums-1
        while low < high:
            point = (low+high)//2
            if nums[point] < nums[high]:
                high = point
            elif nums[point] == nums[high]:
                high -= 1
            else: 
                low = point + 1
            print(low, high)

        return nums[low]


a = Solution()
print(a.findMin([1,3,3])) 